package cn.jekun.shop.app.action;

import javax.annotation.Resource;

import cn.jekun.component.base.bean.ErrorMsg;
import cn.jekun.component.base.exceptions.BusinessException;
import cn.jekun.shop.common.service.AdService;
import net.sf.json.JSONObject;

/**
 * 广告图片
 * @author admin101
 *
 */
@SuppressWarnings("serial")
public class AdAction extends AppBaseAction{	

	@Resource(name = AdService.BEAN_NAME)
	AdService adService;
	
	/**
	 * 广告图片
	 * @return
	 */
	public String getAdimages(){

		JSONObject jsonObject = null;
		try {
		
			jsonObject = this.adService.getAdimages();
		
		} catch (BusinessException e) {
			jsonObject = JSONObject.fromObject(e.getErrorMsg());
		} catch (Exception e) {
			jsonObject = JSONObject.fromObject(new ErrorMsg(e.getMessage()));
			e.printStackTrace();
		}
		return this.writeJson(jsonObject);

	}

}
